import axios from "./index";

//const baseUrl = "http://172.17.2.217:8080"
//新增轮播
export function insertBanner(obj) {
  return axios({
    method:'POST',
    url: '/Rotation/insert',
    data:obj
  });
}
//搜索轮播列表
export function getBannerList(obj) {
  return axios({
    method:'POST',
    url:  `/Rotation/selectLikeOthers/${obj.page}/${obj.size}`,
    data:obj.rotation
  });
}
//删除轮播
export function delBanner(id) {
  return axios({
    method:'POST',
    url: `/Rotation/delete?id=${id}`,
    data:{
      id
    }
  });
}
//编辑轮播
export function editBanner(option) {
  return axios({
    method:'POST',
    url:  "/Rotation/edit",
    data:option
  });
}
//新增
export function insertHandler(path,obj) {
  return axios({
    method:'POST',
    url: `${path}`,
    data:obj
  });
}
//文章搜索
export function getHandler(path,obj) {
  return axios({
    method:'POST',
    url: `${path}/${obj.page}/${obj.size}?inUse=${obj.inUse}`,
    data:obj.artical
  });
}
//意见反馈搜索
export function getHandler1(path,obj) {
  return axios({
    method:'POST',
    url: `${path}/${obj.page}/${obj.size}?inHandle=${obj.inHandle}`,
    data:obj.suggestion
  });
}
//删除
export function delHandler(path,id) {
  return axios({
    method:'POST',
    url: `${path}?id=${id}`,
    data:{
      id
    }
  });
}
//编辑
export function editHandler(path,obj) {
  return axios({
    method:'POST',
    url:  `${path}`,
    data:obj
  });
}
//处理
export function dealOpinionHandler(path,obj) {
  return axios({
    method:'POST',
    url:  `${path}`,
    data:obj
  });
}
//版本搜索
export function getHandler2(path,obj) {
  return axios({
    method:'POST',
    url: `${path}/${obj.page}/${obj.size}/${obj.inEffective}`
  });
}
//启用停用
export function startHandler(path,obj) {
  return axios({
    method:'POST',
    url: `${path}/${obj.id}/${obj.inUse}`,
    data:{
      id:obj.id,
      inUse:obj.inUse
    }
  });
}
//协议搜索
export function getHandler4(path,obj) {
  return axios({
    method:'POST',
    url: `${path}/${obj.page}/${obj.size}`,
  });
}